<?php
namespace Components\Traits;

trait ConstantsTraits {
  public static function getByIndex($key = null, $index = null) {
    if(is_null($key)) { return self::$__constants; }

    if(isset(self::$__constants[$key])) {
      if(is_null($index)) { return self::$__constants[$key]; }

      if(isset(self::$__constants[$key][$index])) { return self::$__constants[$key][$index]; }
    }

    return null;
  }
}
